﻿<%@ Page Title="Title" Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" MasterPageFile="~/Views/Shared/Demo.master" %>
<%@ Register TagPrefix="o" Namespace="Omu.AwesomeWebForms" Assembly="Omu.AwesomeWebForms, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e8b65a0968999f7e" %>
<asp:Content runat="server" ID="Demo" ContentPlaceHolderID="DemoContent">

<h1>AjaxDropdown</h1>
<p class="xpl">a dropdown which can be bound to one or more controls, it changes it's list of options when the value of a parent control is changed, besides values of the parent controls, parameters with predefined values can be set (all these values are sent to a server-side method that returns the list of options) </p>
<h2>simple AjaxDropdown</h2>

    <o:AjaxDropdown runat="server" ID="Fruitys" Url="~/svc/aja.svc/CategoriesDropdown">
        </o:AjaxDropdown>      
        <h2>
            bound to one dropdown by parentId</h2>
        <o:AjaxDropdown runat="server" ID="Categories" Url="~/svc/aja.svc/CategoriesDropdown">
        </o:AjaxDropdown> = 
        <%
            Fruits.ParentId = Categories.ClientID;
        %>
        <o:AjaxDropdown runat="server" ID="Fruits" Url="~/svc/aja.svc/FruitsDropdown"></o:AjaxDropdown>
        <h2>
            bound to 2 dropdowns by using Data</h2>
        <o:AjaxDropdown runat="server" ID="Cat1" Url="~/svc/aja.svc/CategoriesDropdown" Value="1">
        </o:AjaxDropdown> and 
        <o:AjaxDropdown runat="server" ID="Cat2" Url="~/svc/aja.svc/CategoriesDropdown" Value="4">
        </o:AjaxDropdown>    =
            <%
            FruitsFrom2Cat.Data = new Dictionary<string, string>
                                {
                                    {"c1",Cat1.ClientID},
                                    {"c2",Cat2.ClientID}
                                };
%>
        <o:AjaxDropdown runat="server" ID="FruitsFrom2Cat" Url="~/svc/aja.svc/FruitsFrom2CatDropdown"></o:AjaxDropdown>
        
        <h2>bound to Multilookup</h2>
        <o:MultiLookup runat="server" ID="Categories2" GetMultipleUrl="~/svc/aja.svc/CategoryGetMultiple"
            SearchUrl='~/svc/aja.svc/CategorySearch' SelectedUrl="~/svc/aja.svc/CategorySelected"
            Value='["1","2","3"]' OkText="Select" CancelText="Close window"
            Title="Select items and by clicking the up and down buttons" Width="900" Height="500" />
            
            <%
            FruitsFromMulti.ParentId = Categories2.ClientID;
%>
            <o:AjaxDropdown runat="server" ID="FruitsFromMulti" Url="~/svc/aja.svc/FruitsFromMultiDropdown"></o:AjaxDropdown>
            
        <h2>bound to a simple TextBox</h2>
        write 1 or 2 or ... 5
        <asp:TextBox runat="server" ID="txtCategory" Text="1"></asp:TextBox>
          <%
            FruitBoundToTxt.ParentId = txtCategory.ClientID;
        %>
        <o:AjaxDropdown runat="server" ID="FruitBoundToTxt" Url="~/svc/aja.svc/FruitsDropdown"></o:AjaxDropdown> 
               
        
        <h2>Send "Parameters" with predefined values</h2>
        <%
            FruitWithPars.Parameters = new Dictionary<string, string>{ {"category","3"}, {"hi","foo"}, {"ho", "bar"} };
             %>
        <o:AjaxDropdown runat="server" ID="FruitWithPars" Url="~/svc/aja.svc/FruitsWithParsDropdown"></o:AjaxDropdown> 
</asp:Content>
